package jtk.project4.fleet.field;

//septian

import nl.coderight.jazz.form.FormLayout;
import nl.coderight.jazz.form.control.GroupControl;
import nl.coderight.jazz.form.field.ComboField;
import nl.coderight.jazz.form.field.TextField;

public class NewEquipmentGeneralIdentificationField  extends GroupControl{
	private TextField unitField;
	private TextField yearField;
	private ComboField makeField;
	private ComboField modelField;
	private TextField serialField;
	private TextField plateField;
	private ComboField typeField;
	private ComboField colorField;
	private TextField identificationField;
	
	
	public NewEquipmentGeneralIdentificationField(String bindID){
		setTitle("header.identification");
		setBindID(bindID);
		createFields();
		createLayout();
	}
	
	private void createFields(){
		unitField = new TextField ("unit", 20);
		unitField.setRequired(true);
		
		yearField = new TextField ("year", 20);
		yearField.setRequired(true);
		
		makeField = new ComboField("equipments","make");
		makeField.setPreferredSize(unitField.getPreferredSize());
		
		modelField = new ComboField("equipments","model");
		modelField.setPreferredSize(unitField.getPreferredSize());
	
		serialField = new TextField ("year", 20);
		serialField.setRequired(true);
		plateField = new TextField ("year", 20);
		plateField.setRequired(true);
		
		typeField = new ComboField("equipments","make");
		typeField.setPreferredSize(unitField.getPreferredSize());
		
		colorField = new ComboField("equipments","model");
		colorField.setPreferredSize(unitField.getPreferredSize());
		
		identificationField = new TextField ("year", 20);
		identificationField.setRequired(true);
	}
	
	private void createLayout() {
		setLayout(new FormLayout())
		.addLabel("label.unit")		.addField(unitField)
		.addRow()
		.addLabel("label.year").addField(yearField)
		.addRow()
		.addLabel("label.make").addField(makeField)
		.addRow()
		.addLabel("label.Model").addField(modelField)
		.addRow()
		.addLabel("label.serial").addField(serialField)
		.addRow()
		.addLabel("label.plate").addField(plateField)
		.addRow()
		.addLabel("label.type").addField(typeField)
		.addRow()
		.addLabel("label.color").addField(colorField)
		.addRow()
		.addLabel("label.identification").addField(identificationField)
		.addRow()
		;
	}
}
